//
//  SWTempViewController.swift
//  STslender
//
//  Created by mac on 15/12/6.
//  Copyright © 2015年 itcast. All rights reserved.
//

import UIKit

class SWTempViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "当前是第\(navigationController?.childViewControllers.count ?? 0)级控制器"
        view.backgroundColor = UIColor.whiteColor()
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "PUSH", target: self, action: "push")
        
        // 如果当前是第2级控制器
        // 左上角显示第1级控制器的title
        // 否则显示返回
        
        
    }

    @objc private func push(){
        let vc = SWTempViewController()
        navigationController?.pushViewController(vc, animated: true)
    }

    



}
